package com.xinggq.user.api.dto.userrole;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 用户角色关联响应对象
 *
 * @author system
 * @since 2025-01-10
 */
@Data
@Schema(description = "用户角色关联响应对象")
public class UserRoleVO {

    /**
     * 关联ID
     */
    @Schema(description = "关联ID", example = "1234567890123456789")
    private Long id;

    /**
     * 用户ID
     */
    @Schema(description = "用户ID", example = "1234567890123456789")
    private Long userId;

    /**
     * 角色ID
     */
    @Schema(description = "角色ID", example = "9876543210987654321")
    private Long roleId;

    /**
     * 用户名
     */
    @Schema(description = "用户名", example = "zhangsan")
    private String username;

    /**
     * 用户真实姓名
     */
    @Schema(description = "用户真实姓名", example = "张三")
    private String realName;

    /**
     * 角色名称
     */
    @Schema(description = "角色名称", example = "管理员")
    private String roleName;

    /**
     * 角色编码
     */
    @Schema(description = "角色编码", example = "ADMIN")
    private String roleCode;

    /**
     * 分配人ID
     */
    @Schema(description = "分配人ID", example = "1111111111111111111")
    private Long assignedBy;

    /**
     * 分配人姓名
     */
    @Schema(description = "分配人姓名", example = "系统管理员")
    private String assignedByName;

    /**
     * 分配时间
     */
    @Schema(description = "分配时间", example = "2025-01-10T10:30:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime assignedAt;

    /**
     * 状态：1-正常，0-禁用
     */
    @Schema(description = "状态：1-正常，0-禁用", example = "1")
    private Integer status;
}